package util;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
import javax.servlet.http.HttpServletRequest;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.util.stream.Collectors;

public class FANREN {

    static public String getJson(HttpServletRequest request) throws IOException {
        return URLDecoder.decode(new BufferedReader(new InputStreamReader(request.getInputStream()))
                .lines().collect(Collectors.joining(System.lineSeparator())),  StandardCharsets.UTF_8);
    }
}
